local kuiqu = fk.CreateSkill{
  name = "kuiqu",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
    ["kuiqu"] = "魁躯",
    [":kuiqu"] = "锁定技，当你受到1点伤害后，你摸一张牌，伤害来源随机弃置一张牌。",
    ["$kuiqu"] = "身脉合一",
}

kuiqu:addEffect(fk.Damaged, {
  anim_type = "masochism",
  trigger_times = function(self, event, target, player, data)
    return data.damage
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:drawCards(player, 1, kuiqu.name)
    if data.from and not data.from.dead and not data.from:isNude() then
      local cards = data.from:getCardIds("he")
      local cid = cards[math.random(1, #cards)]
      room:throwCard(cid, kuiqu.name, data.from, player)
    end
  end
})

return kuiqu